package software;

import java.util.Iterator;

import softdata.Pla_item;
import softdata.Pos_data;
import softdone.Mai_done;

public class Mai_main extends Mai_done{
	private Pla_item plateitem=new Pla_item();
	private Pos_data postitem=new Pos_data();
	private Iterator iterator;
	private Iterator iterator_posts;

/*
 * 返回板块信息
 */
	public void Begin(int page){
		Pla_Read(page);
		iterator=plates.iterator();
	}
	public void Nextitem(){
		if(iterator.hasNext()){
			plateitem=(Pla_item)iterator.next();
		}
	}

	public int getCur_Plates(){
		//获取当前页板块的数量
		return Sum_Plates;
	}
	public int getID(){
		return plateitem.ID;
	}
	public String getNam_Plate(){
		return plateitem.Nam_Plate;
	}
	public int getNum_Clicks(){
		return plateitem.Num_Clicks;
	}
	public int getNum_Post(){
		return plateitem.Num_Post;
	}
/*
 * 返回帖子信息
 */
	public void  ReadPost(int id){
		Posts_Read(id);
		iterator_posts=posts.iterator();
	}
	public void Nextpost(){
		if(iterator_posts.hasNext()){
			postitem=(Pos_data)iterator_posts.next();
		}
	}


	public int getCur_Posts(){
		//获取当前板块的帖子数量
		return Cur_Posts;
	}
	public int getPost_ID(){
		return postitem.ID_Post;
	}
	public String getPost_Title(){
		return postitem.Title;
	}

	public int getPost_IDUser(){
		return postitem.ID_User;
	}
	public int getPost_NumReply(){
		return postitem.Num_Reply;
	}
	public int getPost_NumClicks(){
		return postitem.Num_Clicks;
	}
	public String getPost_TimLR(){
		return postitem.Tim_ReplyLast;
	}
	public String getPost_Username(){
		return postitem.Name_User;
	}
	/*
	 * 读取 主页 内容
	 */
	public void ReadMain(){
		Main_Content();
	}
	public int getMain_Numtoday(){
		return maincontent.num_today;
	}
	public int getMain_Numyestoday(){
		return maincontent.num_yestoday;
	}
	public int getMain_Sumposts(){
		return maincontent.sum_posts;
	}
	public int getMain_Sumuser(){
		return maincontent.sum_user;
	}
	public String getMain_Namenews(){
		return maincontent.namenews;
	}
	/*
	 * 个人中心帖子信息
	 */

	public int getCur_post_user(int id){
		ListByUsernew(id);
		iterator_posts=posts.iterator();
		return Cur_Posts_User;
	}
	public int getSum_post_user(int id){
		return Num_User_Posts(id);
	}
}